<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title><? $sitename ?></title>
	<? include file=header.tpl ?>
	<h1><? $sitename ?></h1>
	<h2>Directories</h2>
	<ul class="dirs">
		<? if $is_root == false ?>
			<li><a href="../">Go to parent folder</a></li>
		<? /if ?>
		<? section loop=$directories name="dir" ?>
			<li><a href="<? $directories[dir] ?>"><? $directories[dir] ?></a></li>
		<? /section ?>
	</ul>
	<h2>Files</h2>
	<ul class="dls">
		<? if count($downloads) == 0 ?>
			<li>There are no files in this directory.</li>
		<? else ?>
			<? foreach from=$downloads key="fname" item="dl" ?>
				<? if count($dl.downloads) == 1 ?>
					<? foreach from=$dl.downloads key="extention" item="file" ?>
						<li><a href="<? $fname ?><? $extention ?>"><? $dl.name ?> (<? $extention ?> format)</a> <span>(Downloaded <? $dl.count ?> times)</span></li>
					<? /foreach ?>
				<? else ?>
					<li><p><? $dl.name ?> <span>(Downloaded <? $dl.count ?> times)</span></p>
						<ul>
						<? foreach from=$dl.downloads key="extention" item="file" ?>		
							<li><a href="<? $fname ?><? $extention ?>"><? $extention ?> format</a> <span>(Downloaded <? $file.count ?> times)</span></li>
						<? /foreach ?>
						</ul>
					</li>
				<? /if ?>
			<? /foreach ?>
		<? /if ?>
	</ul>
	<? include file=footer.tpl ?>
